#ifndef CONFIG_H
#define CONFIG_H

#include <string>
#include <vector>

class Config {
public:
    Config();
    ~Config();
    
    // 获取配置
    bool getIncludeLetters() const { return includeLetters; }
    bool getIncludeNumbers() const { return includeNumbers; }
    bool getIncludeQuestion() const { return includeQuestion; }
    bool getIncludeEqual() const { return includeEqual; }
    bool getIncludeComma() const { return includeComma; }
    bool getIncludePeriod() const { return includePeriod; }
    bool getIncludeSlash() const { return includeSlash; }
    
    int getCharCount() const { return charCount; }
    int getWpm() const { return wpm; }
    int getFrequency() const { return frequency; }
    
    // 设置配置
    void setIncludeLetters(bool value) { includeLetters = value; }
    void setIncludeNumbers(bool value) { includeNumbers = value; }
    void setIncludeQuestion(bool value) { includeQuestion = value; }
    void setIncludeEqual(bool value) { includeEqual = value; }
    void setIncludeComma(bool value) { includeComma = value; }
    void setIncludePeriod(bool value) { includePeriod = value; }
    void setIncludeSlash(bool value) { includeSlash = value; }
    
    void setCharCount(int value) { charCount = value; }
    void setWpm(int value) { wpm = value; }
    void setFrequency(int value) { frequency = value; }
    
    // 获取字符集
    std::string getCharset() const;
    
    // 获取基础时间（毫秒）
    int getBaseTime() const { return static_cast<int>(1.2 / wpm * 1000); }
    
    // 加载和保存配置
    void loadConfig();
    void saveConfig();
    
private:
    bool includeLetters;     // A-Z
    bool includeNumbers;     // 0-9
    bool includeQuestion;    // ?
    bool includeEqual;       // =
    bool includeComma;       // ,
    bool includePeriod;      // .
    bool includeSlash;       // /
    
    int charCount;           // 随机生成的字符数量
    int wpm;                 // 每分钟莫尔斯码
    int frequency;           // 音频频率
};

#endif // CONFIG_H